package com.wc.AlgoOJ_homework.AlgoOJ_BL1.H_平方差;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/30 12:11
 * @description http://43.138.190.70:8888/p/1103?tid=65f926e1f748afd09501f854
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int l, r;

    // 思路: x = (a + b) * (a - b), 一个数一定可以写成 1 * x,则 a - b = 1,解 x = 2 * b + 1,也就是奇数，全部满足
    // 偶数呢，a - b = 2, x = 4b + 4,可以解出x一定是4的倍数，那么相当于1, 2, 3, 4 里面除了第二个不满足，就全部都满足了
    // 周期形成
    public static void main(String[] args) {
        l = sc.nextInt();
        r = sc.nextInt();
        out.println(dp(r) - dp(l - 1));
        out.flush();
    }

    static long dp(int x) {
        return x / 4 * 3 + x % 4 - (x % 4 >= 2 ? 1 : 0);
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
